package freedom.easyit.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import freedom.easyit.enums.MailTypeEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 邮件历史,eg:
 * <p>
 * 姓名 电子邮件地址 入职时间 性别 出生日期 <br>
 * 龚成伟 gongcw@skyon.com.cn 2020/9/10 男 2020/1/1 <br>
 * </p>
 * 
 * @author Charlie Email:tingfangcao@163.com
 * @date 2020/10/21
 */
@Entity
@Data
@NoArgsConstructor
public class MailHistory {
    public static final String PROP_SEND_AT = "sendAt";
    
    @Id
    @GeneratedValue
    private Long id;
    
    @Column(length = 128, nullable = false)
    private String sendTo;//电子邮箱

    @Column(nullable = false)
    private Date sendAt;//发送日期

    @Enumerated(EnumType.STRING)
    @Column(length = 64, nullable = false)
    private MailTypeEnum mailType;//邮件类型：生日祝福

    /**
     * @param sendTo
     * @param sendAt
     * @param mailType
     */
    public MailHistory(String sendTo, Date sendAt, MailTypeEnum mailType) {
        super();
        this.sendTo = sendTo;
        this.sendAt = sendAt;
        this.mailType = mailType;
    }
    
}
